package utils.independent;

import java.io.File;

import swissmap.Constants;

public class RMAP_rename {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String[] res={"200k","100k","50k","25k","10k"};  //,"20k","10k"};
		for(String curres:res){
			for(int r=0;r<99;r++){
				for(int c=0;c<99;c++){
					File rmap =new File(Constants.basePath+curres+File.separator+curres+"_map_"+((c<10)?"0"+c:c)+"_"+((r<10)?"0"+r:r)+".RMAP");

					if(rmap.exists()){
						File rtmap=new File(Constants.basePath+curres+File.separator+curres+"_map_"+((c<10)?"0"+c:c)+"_"+((r<10)?"0"+r:r)+".RTMAP");
						
						boolean success = rmap.renameTo(rtmap);
						if (!success) { 
							System.out.println("Rename failed "+rmap.getAbsolutePath());  
						}
						//System.out.println(rmap.getAbsolutePath());
					}
				}
			}
		}
		
		// TODO Auto-generated method stub
		// File (or directory) with old name 
		File file = new File("oldname"); // File (or directory) with new name 
		File file2 = new File("newname"); // Rename file (or directory) 
		boolean success = file.renameTo(file2); 
		if (!success) { 
			// File was not successfully renamed  
		}

	}

}
